package com.core.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.core.dao.UserAccountDao;
import com.core.entity.UserAccount;

@Repository("userDao")
public class UserAccountDaoImpl extends GenericDaoImpl<UserAccount, Long> implements UserAccountDao {

	@Override
	public UserAccount findUser(String username) {
		List<UserAccount> result = findAllByProperty("username", username);
		if (result.size() > 0)
			return result.get(0);
		else
			return null;
	}

	@Override
	protected Class<UserAccount> getEntityClass() {
		return UserAccount.class;
	}

}
